Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: type #722

Merged
merged 9 commits into from
Dec 9, 2024
Merged

feat: type #722

merged 9 commits into from
Dec 9, 2024

Conversation

kirillzyusko
Copy link
Owner

@kirillzyusko kirillzyusko commented Dec 7, 2024

📜 Description

Expose type property in EventEmitter events.

💡 Motivation and Context

Added a new property to KeyboardEventData - type. This property reflects keyboardType set on TextInput.

I decided to include more information about the keyboard (we already have a full control over animation properties, but I thought it could be useful to extend the library functionality and include some other properties, such as type/appearance/capitalized and other).

As of now there is no much sense in these properties, but I'm thinking about new API KeyboardController.retain()/KeyboardController.hold() - and in this case it's super useful to know these properties, to re-create the same TextInput and set focus to this newly created input.

However it's only plans, but having this information in the API can be useful, so I decided to add it now.

📢 Changelog

Docs

  • added a reference to a new property;
  • added description to all events;

JS

  • expose type from KeyboardEvents events;
  • updated example app;

iOS

  • added UIKeyboardType extension;
  • move events creation function to its separate KeyboardEventEmitterPayload.swift file to cleanup KeyboardMovementObserver;

Android

  • added EditText.keyboardType extension;

🤔 How Has This Been Tested?

Tested manually on:

  • Pixel 3a API 33 (emulator);
  • iPhone 15 Pro (iOS 17.5).

📸 Screenshots (if appropriate):

image

📝 Checklist

  • CI successfully passed
  • I added new mocks and corresponding unit-tests if library API was changed

@kirillzyusko kirillzyusko added the enhancement New feature or request label Dec 7, 2024
@kirillzyusko kirillzyusko self-assigned this Dec 7, 2024
Copy link
Contributor

github-actions bot commented Dec 7, 2024

📊 Package size report

Current size Target Size Difference
163366 bytes 162576 bytes 790 bytes 📈

@kirillzyusko kirillzyusko added the documentation Improvements or additions to documentation label Dec 9, 2024
Copy link
Contributor

github-actions bot commented Dec 9, 2024

PR Preview Action v1.4.8
🚀 Deployed preview to https://kirillzyusko.github.io/react-native-keyboard-controller/pr-preview/pr-722/
on branch gh-pages at 2024-12-09 11:42 UTC

Copy link

argos-ci bot commented Dec 9, 2024

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Dec 9, 2024, 11:51 AM

@kirillzyusko kirillzyusko marked this pull request as ready for review December 9, 2024 11:55
@kirillzyusko kirillzyusko merged commit 76942c5 into main Dec 9, 2024
31 checks passed
@kirillzyusko kirillzyusko deleted the feat/type branch December 9, 2024 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant